package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.domain.Alcount;
import com.itheima.service.HelloService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("helloController")
@RequestMapping("/hello")
public class HelloController {

    @Reference
    HelloService helloService;

    @RequestMapping("/print")
    public String print(){
        System.out.println("helloworld");
        System.out.println("hello macloud");
        helloService.sayHello();
        return "ok";
    }

    @RequestMapping("/transMoney")
    public String transMoney(){
        helloService.transMoney("zhangsan","lisi",500.0);
       return "succeed";
    }

    @RequestMapping("/findAll")
    public List<Object> findAll(){
        return helloService.findAll();

    }
}
